package com.docmanage.common.enums;

/**
 * @author yhd
 * @create 2023/12/11 19:13
 */
public enum BorrowStatus {

    /**
     * 借阅状态。0：正常。1：被借走。
     */
    ZERO("0","正常"),ONE("1","被借走");

    private String code;

    private String name;

    BorrowStatus(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static BorrowStatus getNameByCode(String code){
        for (BorrowStatus statusEnums: values()){
            if (statusEnums.getCode().equals(code)){
                return statusEnums;
            }
        }
        return ZERO;
    }
}
